home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
term
/
vltfonebook.lha
/
VLTFoneBook
/
VLTDialer.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-07-29
|
2KB
|
78 lines
/*****************************************************************************
*** VLTDialer.rexx
*** dial a phone number inside vlt
*****************************************************************************/
/** Hayes modem responses **/
response = "OK"
connectstr = "CONNECT"
busystr = "BUSY"
nocarrierstr = "NO CARRIER"
DialStr = "ATDT" /* hayes modem dial prefix */
/** simple hangup script (drop DTR) **/
hangupscript = "hangup"
/** set the port to that of this invocation of VLT **/
parse arg vltport ',' name ',' phone baud parity script
address value vltport
/** '-' in script field means no script **/
script = strip(script)
if script = "-" then script = ""
/** Check if set up correctly without requesters coming up. **/
call pragma('W', 'NULL')
/** Dialing procedure follows **/
/** Preset the cancel flag to something, set baud and parity. **/
vlt.CANCELFLAG = "start"
if length(baud) > 0 then "baud "baud
if length(parity) > 0 then "parity "parity
/** try until connect **/
do forever
/** Set up the "CONNECT" trap. **/
/** Set up the OK, CONNECT, BUSY and NO CARRIER traps. **/
"trap add 314 install ("connectstr") (cancel $vltphone_wait "connect")"
"trap add 315 install ("busystr") (cancel $vltphone_wait "busy")"
"trap add 316 install ("nocarrierstr") (cancel $vltphone_wait "nocarrier")"
/** Send dial string and wait until the "pause" gets cancelled **/
if length(phone) > 0 then do
"move 1 1; emit (Dialing"name"...); move 1 2"
"$vltphone_wait: send ("DialStr||phone"*r); pause"
end
else do
"message (please give a phone number.)"
exit
end
/** We got cancelled. See which event cancelled us. **/
event = vlt.CANCELFLAG
/** Remove the traps but only the ones we used. **/
"trap remove 313 314 315 316"
/** If we got connected, close the panel if it exists **/
if upper(event) = "CONNECT" then do
if showlist('p', VLTPHONEBOOK) ~= 0 then do
"message"
address VLTPHONEBOOK quit
end
if script ~= "" then "@@VLTFoneBook:"script
exit(0)
end
/** Check if we got an abort event. If so, quit. **/
if upper(event) = "ABORT" then do
"message (Aborted!)"
exit(0)
end
end
/** end **/